/*
 * Copyright (c) 2010-present www.walkerljl.org All Rights Reserved.
 * The software source code all copyright belongs to the author, 
 * without permission shall not be any reproduction and transmission.
 */
package org.walkerljl.practice.pattern;

/**
 * Singleton
 *
 * @author lijunlin<walkerljl@qq.com>
 */
public class Singleton {

    private Singleton() {
    }

    public static Singleton getInstance() {
        return SingletonHolder.instance;
    }

    /**
     * 内部静态类，使用JVM确保只加载一次
     */
    private static class SingletonHolder {
        private static Singleton instance = new Singleton();
    }
}
